#include <stdio.h>
#include <math.h>


#if 0
int main(int argc, char const *argv[])
{
/*   
//比较大小
    int a,b;
    printf("请输入两个整数>:");
    scanf("%d%d",&a,&b);
    printf("a=%d,b=%d\n",a,b);

    if(a<b)
    {
        printf("%d<%d\n",a,b);
    }
    else if(a>b)
    {
        printf("%d>%d\n",a,b);
    }
    else
    {
        printf("%d=%d\n",a,b);

    }
*/
//switch
    char level;
    printf("请输入成绩的级别(A/B/C/D/E)>:");
    scanf("%c",&level);
    printf("level=%c\n",level);

    switch (level)
    {
    case 'A':
        printf("90<=成绩<=100\n");
        break;
     case 'B':
        printf("80<=成绩<90\n");
        break;
     case 'C':
        printf("70<=成绩<80\n");
        break;
     case 'D':
        printf("60<=成绩<70\n");
        break;
     case 'E':
        printf("0<=成绩<60\n");
        break;
    
    default:
        printf("输入的成绩级别错误，请从新输入");
        break;
    }

/*
//for   输出100以内的奇数

    for (int i = 0; i <= 100; i++)
    {
        if(i%2==1)
        {
            printf("i=%d\n",i);
        }
    }

  //水仙花数
    int a,b,c;
    for (int i = 100; i <= 999; i++)
    {
        a = i/100;        //百位数
        b = i%100/10;     //十位数
        c = i%10;         //个位数
        if(i==a*a*a+b*b*b+c*c*c)
        {
            printf("i=%d\n",i);
        }
        
    }
 //图形显示
   for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            printf("* ");
        }
        printf("\n");
    }
printf("\n");
    for (int i = 0; i < 5; i++)
    {
        for (int j = 5; j > i ; j--)
        {
            printf("* ");
        }
        printf("\n");
    }
printf("\n");


    for (int i = 0; i < 5; i++)
    {
        for (int j = 5; j > i ; j--)    //for (int j = 0; j < 5-i ; j--)
        {
            printf("* ");
        }
        printf("\n");
        
    }

    for (int i = 1; i < 5; i++)         //for (int i = 1; i < 5-1; i++)
    {
        for (int j = 0; j <= i; j++)    //for (int j = 0; j <= i+1; j++)
        {
            printf("* ");
        }
        printf("\n");
    }   

//while
    int i = 0, sum = 0;
    while(i < 100)
    {
        i++;
        sum += i;
    }
    printf("sum=%d\n",sum);

//do while
    int i = 0, sum = 0;
    do
    {
        i++;
        sum += i;
    } while (i<100);
    printf("sum=%d\n",sum);    

    int i=0,sum=0;
step:
    i++;
    sum += i;
    if(i<100)
    {
        goto step;
    }
    printf("sum=%d\n",sum);
*/
//一天多少小时

    int sec = 0, min = 0, hour = 0, count = 0;
    while (1)
    {
        printf("HH:MM:SS-->%02d:%02d:%02d\n",hour,min,sec);
        sec++;
        count++;
        if (sec<60)continue;
            sec=0;
            min++;

        if (min<60)continue;
            min=0;
            hour++;

        if(hour<24)continue;
            hour=0;
            break;
    }
    printf("一天有%d秒",count);

    return 0;
}

#else

int main(int argc, char const *argv[])
{
/*
//100以内的素数
    int i,j;
    for (  i = 2; i < 100; i++)
    {
        for ( j = 2; j < 100; j++)
        {
            if (i%j==0)
            {
                break;
            }
        }
        if (j==i)
         {
            printf("%d ",i);
        }
        
    } 


//公约数和公倍数   
    int m,n,p,r,temp;
    printf("请输入两个正整数>:");
    scanf("%d%d",&n,&m);

    if(n<m)
    {
        temp = n;
        n = m;
        m = temp;       //把大数放到n中，小数放到m中 
    }
    p = n * m;      //先将n和m的乘积保存到p中，便于求最小公倍数用
    while(m!=0)     //求n和m的最大公约数(直到m=0，停止执行，这个程序一共执行了两边)
    {   
        r = n % m ;
        n = m ; 
        m = r ;      
    } 

    printf("它们的最大公约数为:%d\n",n);
    printf("它们的最小公倍数为:%d\n",p/n);  //p是原来两个整数的乘积

//99乘法表
    for (int i = 1; i < 10; i++)
    {
        for (int j = 1; j <= i; j++)
        {  
            printf("%d×%d=%-2d ",j,i,j*i);
        }
        printf("\n");
    }
*/
//输入年份，判断为闰年
    int n;
    printf("输入年份-->:");
    scanf("%d",&n); 
    printf("n=%d\n",n);
    if ( (n%4==0) && (n%100!=0) || (n%400==0))
    {
        printf("是闰年\n");
    }
    else
    {
        printf("不是闰年\n");
    }
/*
//循环输出26英文字母(循环5次)
    for(int i=0;i<5;i++)
    {
        for (int i = 65; i < 91; i++)
        {
            putchar(i);
        }
        printf("\n");
    }
*/
    return 0;
}


#endif
